thinkphp6 paginate() 分页数据处理后输出://model里面的分页函数
public function pageQuery(){
$rs = $this->where($where)->field(true)->order('id desc')->paginate()
->each(function($item, $key){
if($item['status']==1){
$item['name1'] = $item['name2'];
}
$item['imgSize'] = round($item['imgSize']/1024/1024,2);
return $item;
});
return $rs;
}